package com.sc.byahi.user.shared;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

//import javax.persistence.Id;

public class Profile extends AbstractEntity<Long> {
	private static final long serialVersionUID = 1L;
//	@Id
	protected Long id = null;

	private String aboutMe = "";
	private Boolean approved = false;
	private String bloodGroup = "";
	private String caste = "";
	private String currCity = "";
	private String currCountry = "";
	private String currGeoAddress = "";
	private Double currLatitude;
	private Double currLongitude;
	private String currState = "";
	private List<String> degrees = new ArrayList<String>();
	private Date dob;
	private String eatingHabits = "";
	private String employmentType = "";
	private String familyLivingWithMe = "No";
	private String famCity = "";
	private String famCountry = "";
	private String famGeoAddress = "";
	private Double famLatitude;
	private Double famLongitude;
	private String famState = "";
	private String gender = "Female";
	private Long height = 60l; 
	private List<String> images = new ArrayList<String>();
	
	// This field is only for VO, not to be persisted, hence not added to properties list.
	private List<String> imageURLs = new ArrayList<String>();
	
	private List<String> languages = new ArrayList<String>();
	private String manglik = "";
	private String maritalStatus = "Unmarried";
	private String maritalStatusChildren = "";
	private String motherTongue = "";
	private String name = "";
	private String owner = "";
	private Boolean ownerAgency = false;
	private String physicalStatus = "Normal";
	private String physicalStatusDetail = "";
	private String religion = "";
	private String smoking = "";

	public static final String ABOUT_ME = "aboutMe";
	public static final String APPROVED = "approved";
	public static final String BLOOD_GROUP = "bloodGroup";
	public static final String CASTE = "caste";
	public static final String CURR_CITY = "currCity";
	public static final String CURR_COUNTRY = "currCountry";
	public static final String CURR_GEOADDRESS = "currGeoAddress";
	public static final String CURR_LATITUDE = "currLatitude";
	public static final String CURR_LONGITUDE = "currLongitude";
	public static final String CURR_STATE = "currState";
	public static final String DEGREES = "degrees";
	public static final String DOB = "dob";
	public static final String EATING_HABITS = "eatingHabits";
	public static final String EMPLOYMENT_TYPE = "employmentType";
	public static final String FAMILY_LIVING_WITH_ME = "familyLivingWithMe";
	public static final String FAM_CITY = "famCity";
	public static final String FAM_COUNTRY = "famCountry";
	public static final String FAM_GEOADDRESS = "famGeoAddress";
	public static final String FAM_LATITUDE = "famLatitude";
	public static final String FAM_LONGITUDE = "famLongitude";
	public static final String FAM_STATE = "famState";
	public static final String GENDER = "gender";
	public static final String HEIGHT = "height";
	public static final String IMAGES = "images";
	public static final String LANGUAGES = "languages";
	public static final String MANGLIK = "manglik";
	public static final String MARITAL_STATUS = "maritalStatus";
	public static final String MARITAL_STATUS_CHILDREN = "maritalStatusChildren";
	public static final String MOTHER_TONGUE = "motherTongue";
	public static final String NAME = "name";
	public static final String OWNER = "owner";
	public static final String OWNER_AGENCY = "ownerAgency";
	public static final String PHYSICAL_STATUS = "physicalStatus";
	public static final String PHYSICAL_STATUS_DETAIL = "physicalStatusDetail";
	public static final String RELIGION = "religion";
	public static final String SMOKING = "smoking";
	
	public Profile() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		if (id != null) {
			this.id = id;
		}
	}

	@Override
	public List<String> getUnindexedPropertyNames() {
		List<String> props = new ArrayList<String>();
		props.add(ABOUT_ME);
		props.add(BLOOD_GROUP);
		props.add(CURR_CITY);
		props.add(CURR_GEOADDRESS);
		props.add(CURR_LATITUDE);
		props.add(CURR_LONGITUDE);
		props.add(CURR_STATE);
		props.add(FAM_CITY);
		props.add(FAM_COUNTRY);
		props.add(FAM_GEOADDRESS);
		props.add(FAM_LATITUDE);
		props.add(FAM_LONGITUDE);
		props.add(FAM_STATE);
		props.add(FAMILY_LIVING_WITH_ME);
		props.add(IMAGES);
		props.add(MARITAL_STATUS_CHILDREN);
		props.add(NAME);
		props.add(OWNER_AGENCY);
		props.add(PHYSICAL_STATUS_DETAIL);
		props.add(SMOKING);
		return props;
	}

	@Override
	public List<String> getIndexedPropertyNames() {
		List<String> props = new ArrayList<String>();
		props.add(APPROVED);
		props.add(CASTE);
		props.add(CURR_COUNTRY);
		props.add(DEGREES);
		props.add(DOB);
		props.add(EATING_HABITS);
		props.add(EMPLOYMENT_TYPE);
		props.add(GENDER);
		props.add(HEIGHT);
		props.add(LANGUAGES);
		props.add(MANGLIK);
		props.add(MARITAL_STATUS);
		props.add(MOTHER_TONGUE);
		props.add(OWNER);
		props.add(PHYSICAL_STATUS);
		props.add(RELIGION);
		return props;
	}

	public Object getProperty(String key) {
		if (ABOUT_ME.equals(key))
			return getAboutMe();
		if (APPROVED.equals(key))
			return getApproved();
		if (BLOOD_GROUP.equals(key))
			return getBloodGroup();
		if (CASTE.equals(key))
			return getCaste();
		if (CURR_CITY.equals(key))
			return getCurrCity();
		if (CURR_COUNTRY.equals(key))
			return getCurrCountry();
		if (CURR_GEOADDRESS.equals(key))
			return getCurrGeoAddress();
		if (CURR_LATITUDE.equals(key))
			return getCurrLatitude();
		if (CURR_LONGITUDE.equals(key))
			return getCurrLongitude();
		if (CURR_STATE.equals(key))
			return getCurrState();
		if (DEGREES.equals(key))
			return getDegrees();
		if (DOB.equals(key))
			return getDob();
		if (EATING_HABITS.equals(key))
			return getEatingHabits();
		if (EMPLOYMENT_TYPE.equals(key))
			return getEmploymentType();
		if (FAM_CITY.equals(key))
			return getFamCity();
		if (FAM_COUNTRY.equals(key))
			return getFamCountry();
		if (FAM_GEOADDRESS.equals(key))
			return getFamGeoAddress();
		if (FAM_LATITUDE.equals(key))
			return getFamLatitude();
		if (FAM_LONGITUDE.equals(key))
			return getFamLongitude();
		if (FAM_STATE.equals(key))
			return getFamState();
		if (FAMILY_LIVING_WITH_ME.equals(key))
			return getFamilyLivingWithMe();
		if (GENDER.equals(key))
			return getGender();
		if (HEIGHT.equals(key))
			return getHeight();
		if (IMAGES.equals(key))
			return getImages();
		if (LANGUAGES.equals(key))
			return getLanguages();
		if (MANGLIK.equals(key))
			return getManglik();
		if (MARITAL_STATUS.equals(key))
			return getMaritalStatus();
		if (MARITAL_STATUS_CHILDREN.equals(key))
			return getMaritalStatusChildren();
		if (MOTHER_TONGUE.equals(key))
			return getMotherTongue();
		if (NAME.equals(key))
			return getName();
		if (OWNER.equals(key))
			return getOwner();
		if (OWNER_AGENCY.equals(key))
			return getOwnerAgency();
		if (PHYSICAL_STATUS.equals(key))
			return getPhysicalStatus();
		if (PHYSICAL_STATUS_DETAIL.equals(key))
			return getPhysicalStatusDetail();
		if (RELIGION.equals(key))
			return getReligion();
		if (SMOKING.equals(key))
			return getSmoking();
		return null;
	}

	@SuppressWarnings("unchecked")
	public void setProperty(String key, Object value) {
		if (ABOUT_ME.equals(key)) {
			setAboutMe((String) value);
			return;
		}
		if (APPROVED.equals(key)) {
			setApproved((Boolean) value);
			return;
		}
		if (BLOOD_GROUP.equals(key)) {
			setBloodGroup((String) value);
			return;
		}
		if (CASTE.equals(key)) {
			setCaste((String) value);
			return;
		}
		if (CURR_CITY.equals(key)) {
			setCurrCity((String) value);
			return;
		}
		if (CURR_COUNTRY.equals(key)) {
			setCurrCountry((String) value);
			return;
		}
		if (CURR_GEOADDRESS.equals(key)) {
			setCurrGeoAddress((String) value);
			return;
		}
		if (CURR_LATITUDE.equals(key)) {
			setCurrLatitude((Double) value);
			return;
		}
		if (CURR_LONGITUDE.equals(key)) {
			setCurrLongitude((Double) value);
			return;
		}
		if (CURR_STATE.equals(key)) {
			setCurrState((String) value);
			return;
		}
		if (DEGREES.equals(key)) {
			setDegrees((List<String>) value);
			return;
		}
		if (DOB.equals(key)) {
			setDob((Date) value);
			return;
		}
		if (EATING_HABITS.equals(key)) {
			setEatingHabits((String) value);
			return;
		}
		if (EMPLOYMENT_TYPE.equals(key)) {
			setEmploymentType((String) value);
			return;
		}
		if (FAM_CITY.equals(key)) {
			setFamCity((String) value);
			return;
		}
		if (FAM_COUNTRY.equals(key)) {
			setFamCountry((String) value);
			return;
		}
		if (FAM_GEOADDRESS.equals(key)) {
			setFamGeoAddress((String) value);
			return;
		}
		if (FAM_LATITUDE.equals(key)) {
			setFamLatitude((Double) value);
			return;
		}
		if (FAM_LONGITUDE.equals(key)) {
			setFamLongitude((Double) value);
			return;
		}
		if (FAM_STATE.equals(key)) {
			setFamState((String) value);
			return;
		}
		if (FAMILY_LIVING_WITH_ME.equals(key)) {
			setFamilyLivingWithMe((String) value);
			return;
		}
		if (GENDER.equals(key)) {
			setGender((String) value);
			return;
		}
		if (HEIGHT.equals(key)) {
			setHeight((Long) value);
			return;
		}
		if (IMAGES.equals(key)) {
			setImages((List<String>) value);
			return;
		}
		if (LANGUAGES.equals(key)) {
			setLanguages((List<String>) value);
			return;
		}
		if (MANGLIK.equals(key)) {
			setManglik((String) value);
			return;
		}
		if (MARITAL_STATUS.equals(key)) {
			setMaritalStatus((String) value);
			return;
		}
		if (MARITAL_STATUS_CHILDREN.equals(key)) {
			setMaritalStatusChildren((String) value);
			return;
		}
		if (MOTHER_TONGUE.equals(key)) {
			setMotherTongue((String) value);
			return;
		}
		if (NAME.equals(key)) {
			setName((String) value);
			return;
		}
		if (OWNER.equals(key)) {
			setOwner((String) value);
			return;
		}
		if (OWNER_AGENCY.equals(key)) {
			setOwnerAgency((Boolean) value);
			return;
		}
		if (PHYSICAL_STATUS.equals(key)) {
			setPhysicalStatus((String) value);
			return;
		}
		if (PHYSICAL_STATUS_DETAIL.equals(key)) {
			setPhysicalStatusDetail((String) value);
			return;
		}
		if (RELIGION.equals(key)) {
			setReligion((String) value);
			return;
		}
		if (SMOKING.equals(key)) {
			setSmoking((String) value);
			return;
		}
	}

	public Boolean getApproved() {
		return approved;
	}

	public void setApproved(Boolean approved) {
		this.approved = approved;
	}

	public void addImage(String imagesBlobKey) {
		this.images.add(imagesBlobKey);
	}

	public List<String> getImages() {
		return images;
	}

	public void setImages(List<String> images) {
		if (images != null)
			this.images = images;
	}

	public List<String> getImageURLs() {
		return imageURLs;
	}

	public void setImageURLs(List<String> imageURLs) {
		this.imageURLs = imageURLs;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		if (name != null)
			this.name = name;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		if (gender != null)
			this.gender = gender;
	}

	public Long getHeight() {
		return height;
	}

	public void setHeight(Long height) {
		if (height != null)
			this.height = height;
	}

	public String getBloodGroup() {
		return bloodGroup;
	}

	public void setBloodGroup(String bloodGroup) {
		if (bloodGroup != null)
			this.bloodGroup = bloodGroup;
	}

	public String getPhysicalStatus() {
		return physicalStatus;
	}

	public void setPhysicalStatus(String physicalStatus) {
		if (physicalStatus != null)
			this.physicalStatus = physicalStatus;
	}

	public String getPhysicalStatusDetail() {
		return physicalStatusDetail;
	}

	public void setPhysicalStatusDetail(String physicalStatusDetail) {
		if (physicalStatusDetail != null)
			this.physicalStatusDetail = physicalStatusDetail;
	}

	public String getMaritalStatus() {
		return maritalStatus;
	}

	public void setMaritalStatus(String maritalStatus) {
		if (maritalStatus != null)
			this.maritalStatus = maritalStatus;
	}

	public List<String> getDegrees() {
		return degrees;
	}

	public void setDegrees(List<String> degrees) {
		if (degrees != null)
			this.degrees.clear();
		this.degrees.addAll(degrees);
	}

	public String getAboutMe() {
		return aboutMe;
	}

	public void setAboutMe(String aboutMe) {
		if (aboutMe != null)
			this.aboutMe = aboutMe.trim();
	}

	public String getMaritalStatusChildren() {
		return maritalStatusChildren;
	}

	public void setMaritalStatusChildren(String maritalStatusChildren) {
		if (maritalStatusChildren != null)
			this.maritalStatusChildren = maritalStatusChildren;
	}

	public Date getDob() {
		return dob;
	}

	public void setDob(Date dob) {
		this.dob = dob;
	}

	public String getManglik() {
		return manglik;
	}

	public void setManglik(String manglik) {
		if (manglik != null)
			this.manglik = manglik;
	}

	public String getReligion() {
		return religion;
	}

	public void setReligion(String religion) {
		if (religion != null)
			this.religion = religion;
	}

	public String getCaste() {
		return caste;
	}

	public void setCaste(String caste) {
		if (caste != null)
			this.caste = caste.trim();
	}

	public String getMotherTongue() {
		return motherTongue;
	}

	public void setMotherTongue(String motherTongue) {
		if (motherTongue != null)
			this.motherTongue = motherTongue;
	}

	public List<String> getLanguages() {
		return languages;
	}

	public void setLanguages(List<String> languages) {
		if (languages != null) {
			this.languages.clear();
			this.languages.addAll(languages);
		}
	}

	public String getEatingHabits() {
		return eatingHabits;
	}

	public void setEatingHabits(String eatingHabits) {
		if (eatingHabits != null)
			this.eatingHabits = eatingHabits;
	}

	public String getSmoking() {
		return smoking;
	}

	public void setSmoking(String smoking) {
		if (smoking != null)
			this.smoking = smoking;
	}

	public String getEmploymentType() {
		return employmentType;
	}

	public void setEmploymentType(String employmentType) {
		if (employmentType != null)
			this.employmentType = employmentType;
	}

	public String getFamilyLivingWithMe() {
		return familyLivingWithMe;
	}

	public void setFamilyLivingWithMe(String familyLivingWithMe) {
		if (familyLivingWithMe != null)
			this.familyLivingWithMe = familyLivingWithMe;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		if (owner != null)
			this.owner = owner;
	}

	public Boolean getOwnerAgency() {
		return ownerAgency;
	}

	public void setOwnerAgency(Boolean ownerAgency) {
		if (ownerAgency != null)
			this.ownerAgency = ownerAgency;
	}

	public Double getCurrLatitude() {
		return currLatitude;
	}

	public void setCurrLatitude(Double currLatitude) {
		if (currLatitude != null)
			this.currLatitude = currLatitude;
	}

	public Double getCurrLongitude() {
		return currLongitude;
	}

	public void setCurrLongitude(Double currLongitude) {
		if (currLongitude != null)
			this.currLongitude = currLongitude;
	}

	public String getCurrCity() {
		return currCity;
	}

	public void setCurrCity(String currCity) {
		if (currCity != null)
			this.currCity = currCity;
	}

	public String getCurrState() {
		return currState;
	}

	public void setCurrState(String currState) {
		if (currState != null)
			this.currState = currState;
	}

	public String getCurrCountry() {
		return currCountry;
	}

	public void setCurrCountry(String currCountry) {
		if (currCountry != null)
			this.currCountry = currCountry;
	}

	public Double getFamLatitude() {
		return famLatitude;
	}

	public void setFamLatitude(Double famLatitude) {
		if (famLatitude != null)
			this.famLatitude = famLatitude;
	}

	public Double getFamLongitude() {
		return famLongitude;
	}

	public void setFamLongitude(Double famLongitude) {
		if (famLongitude != null)
			this.famLongitude = famLongitude;
	}

	public String getFamCity() {
		return famCity;
	}

	public void setFamCity(String famCity) {
		if (famCity != null)
			this.famCity = famCity;
	}

	public String getFamState() {
		return famState;
	}

	public void setFamState(String famState) {
		if (famState != null)
			this.famState = famState;
	}

	public String getFamCountry() {
		return famCountry;
	}

	public void setFamCountry(String famCountry) {
		if (famCountry != null)
			this.famCountry = famCountry;
	}

	public String getCurrGeoAddress() {
		return currGeoAddress;
	}

	public void setCurrGeoAddress(String currGeoAddress) {
		if (currGeoAddress != null)
			this.currGeoAddress = currGeoAddress;
	}

	public String getFamGeoAddress() {
		return famGeoAddress;
	}

	public void setFamGeoAddress(String famGeoAddress) {
		if (famGeoAddress != null)
			this.famGeoAddress = famGeoAddress;
	}
}
